<template>
    <div class="discountCouponList">
        <div style="font-size:15px;margin-bottom:20px;font-width:700;padding-left: 20px;">选择优惠券</div>
        <div class="selectDiscountCoupon">
            <div style="display:flex">
                <div style=" width:30%;margin:auto 0">券标题</div>
                <el-input v-model="input" placeholder="请选择券类型" style="margin-right:20px"></el-input>
            </div>
            <div style="display:flex">
                <div style=" width:30%;margin:auto 0">券类型</div>
                <el-select v-model="value" placeholder="请选择券类型">
                    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                    </el-option>
                </el-select>
            </div>
            <div style="display:flex;margin-left:20px">
                <el-button style="background-color:rgb(88,99,222);color:#fff;margin-right:10px">查询</el-button>
                <div style="border-bottom:1px solid #000;width:25px;margin:auto 0">重置</div>
            </div>
        </div>
        <div>
            <div style="background-color:rgb(254,249,236);padding:10px 20px">
                已选择0项
            </div>
            <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100% ;padding-left: 20px;"
                @selection-change="handleSelectionChange">
                <el-table-column type="selection" width="100">
                </el-table-column>
                <el-table-column label="券标题" width="200">
                    <template slot-scope="scope">{{ scope.row.date }}</template>
                </el-table-column>
                <el-table-column prop="ticketTitle" label="券类型" width="200">
                </el-table-column>
                <el-table-column prop="inventory" label="库存" show-overflow-tooltip>
                </el-table-column>
                <el-table-column prop="effectiveDate" label="生效日期" show-overflow-tooltip>
                </el-table-column>
                <el-table-column prop="expiryDate" label="失效日期" show-overflow-tooltip>
                </el-table-column>
            </el-table>
        </div>
        <div style=" text-align: right;padding-right:100px;margin-top:20px;margin-bottom:20px">
            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
                :current-page="currentPage4" :page-sizes="[100, 200, 300, 400]" :page-size="100"
                layout="total, sizes, prev, pager, next, jumper" :total="400">
            </el-pagination>
            <div style="margin-top:20px">
                <el-button>取消</el-button>
                <el-button style="background-color:rgb(88,99,222);color:#fff;margin-right:10px">确认</el-button>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    name: 'ChuzhiList',
    data() {
        return {
            input: '',
            options: [{
                value: '选项1',
                label: '黄金糕'
            }, {
                value: '选项2',
                label: '双皮奶'
            }, {
                value: '选项3',
                label: '蚵仔煎'
            }, {
                value: '选项4',
                label: '龙须面'
            }, {
                value: '选项5',
                label: '北京烤鸭'
            }],
            value: '',
            tableData: [{
                date: '天天神券',
                ticketTitle: '满减券',
                inventory: '123',
                effectiveDate: '领券后',
                expiryDate: '1天'
            }, {
                date: '天天神券',
                ticketTitle: '满减券',
                inventory: '123',
                effectiveDate: '领券后',
                expiryDate: '1天'
            }, {
                date: '天天神券',
                ticketTitle: '满减券',
                inventory: '123',
                effectiveDate: '领券后',
                expiryDate: '1天'
            }],
            multipleSelection: [],
            currentPage1: 5,
            currentPage2: 5,
            currentPage3: 5,
            currentPage4: 4
        }
    },
    methods: {
        toggleSelection(rows) {
            if (rows) {
                rows.forEach(row => {
                    this.$refs.multipleTable.toggleRowSelection(row);
                });
            } else {
                this.$refs.multipleTable.clearSelection();
            }
        },
        handleSelectionChange(val) {
            this.multipleSelection = val;
        },
        handleSizeChange(val) {
            console.log(`每页 ${val} 条`);
        },
        handleCurrentChange(val) {
            console.log(`当前页: ${val}`);
        }
    }

}
</script>

<style scoped lang="scss">
.discountCouponList {
    margin-top: 20px;
    padding-top: 20px;
    background-color: #fff;

    .selectDiscountCoupon {
        display: flex;
        padding-left: 20px;
        margin-bottom: 20px;
       
    }
}
</style>